﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

namespace $safeprojectname$.Web
{
    /// <summary>
    ///     A model for ListView control.
    ///     Properties support paging, sorting, readonly access...
    /// </summary>
    public interface IListModel : IFilterModel<IFilter>
    {
        /// <summary>
        ///     The list of generalized items to be displayed in ListWC.
        ///     Any entity could be transferd to IItemToDisplay
        ///     and therefore ListWC can be implemented only once
        /// </summary>
        IEnumerable<IItemToDisplay> ItemsToDisplay { get; set; }

        /// <summary>
        ///     AOP (authorization) filter should (must) set this property
        /// </summary>
        bool IsReadOnly { get; set; }

        /// <summary>Adjust the ListView rendering with a leading Checkbox or Radio column (or nothing)</summary>
        RowRenderMode RowRenderMode { get; set; }

        /// <summary>
        ///     True: decorate TD text with anchor, False: only text without navigation is rendered.
        ///     Default is true
        /// </summary>
        bool ShowDetailAction { get; set; }

        /// <summary>
        ///     True will render Edit link on the Table left side.
        ///     Default is true.
        /// </summary>
        bool ShowEditOnLeft { get; set; }

        /// <summary>
        ///     If set to 'false' Table header does not provide sorting links.
        ///     Default is 'true'.
        /// </summary>
        bool AllowSorting { get; set; }

        /// <summary>
        ///     Would be 'buttons' for next, previous ... rendered?
        /// </summary>
        bool HidePagingButtons { get; set; }

        /// <summary>
        ///     Allows to extend the link URL generated for each list row
        ///     with some additional paramters for edit and detail
        ///     (e.g. AopUrlFilterAttribute with asked MasterPage)
        /// </summary>
        IDictionary<string, object> AdditionalParameters { get; }

        /// <summary>
        ///     Allows to extend the link URL generated for each list row
        ///     with some additional paramters for delete
        ///     (e.g. AopUrlFilterAttribute with asked MasterPage)
        /// </summary>
        IDictionary<string, object> AdditionalDeleteParameters { get; }

        string CurrentController { get; set; }
        string CurrentAction { get; set; }

        /// If there is non empty value, then edit anchor on List view
        /// will target this window (list will be displayed in one window
        /// and detail+edit in another window)
        string TargetNameForLink { get; set; }

        void SetFilter(Func<IFilter> filterExpression);
        void SetCurrentController(Func<string> currentController);
        void SetCurrentAction(Func<string> currentAction);

        /// <summary>
        ///     Caption could be rendered even if there is only one page. Default is false
        /// </summary>
        bool ShowCaptionAlways { get; set; }
    }
}